

@RestController
@RequestMapping("/fmsMaterialConfig")
public class FmsMaterialConfigController {

    @Resource
    private FmsMaterialConfigService fmsMaterialConfigService;


    /**
     * 获取 FmsMaterialConfig 分页列表
     */
    @GetMapping("/pagination")
    public Ret getFmsMaterialConfigPagination( PaginationVo paginationVo, FmsMaterialConfigQuery fmsMaterialConfigQuery ) throws Exception {
        IPage page = fmsMaterialConfigService.getFmsMaterialConfigPagination(paginationVo, fmsMaterialConfigQuery );
        return Ret.toPage(page);
    }


    /**
     * 获取 FmsMaterialConfig 所有数据
     */
    @GetMapping("/all")
    public Ret getFmsMaterialConfigAllList( FmsMaterialConfigQuery fmsMaterialConfigQuery ) throws Exception {
        List<FmsMaterialConfigEntity> list = fmsMaterialConfigService.getFmsMaterialConfigAllList( fmsMaterialConfigQuery );
        return Ret.ok(list);
    }



    /**
     * 获取 FmsMaterialConfig 详情
    */
   @GetMapping("/{id}")
   public Ret getFmsMaterialConfigDetail(@PathVariable Long id) throws Exception {

       FmsMaterialConfigEntity fmsMaterialConfig = fmsMaterialConfigService.getFmsMaterialConfigDetail(id);
       return Ret.ok(fmsMaterialConfig);
   }


    /**
     * 新增 FmsMaterialConfig
     * */
    @PostMapping("")
    public Ret addFmsMaterialConfig(@RequestBody FmsMaterialConfigVo fmsMaterialConfigVo) throws Exception {

        fmsMaterialConfigService.addFmsMaterialConfig(fmsMaterialConfigVo);
        return Ret.ok();
    }


    /**
     * 更新 FmsMaterialConfig
     * */
    @PutMapping("")
    public Ret updateFmsMaterialConfig(@RequestBody FmsMaterialConfigVo fmsMaterialConfigVo) throws Exception {

        fmsMaterialConfigService.updateFmsMaterialConfig(fmsMaterialConfigVo);
        return Ret.ok();
    }


    /**
     * 删除 FmsMaterialConfig
     * */
    @PostMapping("/batchRemove")
    public Ret batchRemoveFmsMaterialConfig( @RequestBody List<Long> ids ) throws Exception {

        fmsMaterialConfigService.batchRemoveFmsMaterialConfig(ids);
        return Ret.ok();
    }
}

  